<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('机构席位')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="btn-group-sm" id="toolbar" role="group">
                 <select class="form-control" id="datePicker" name="type" oninput="change()"></select>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var trade_date_list =[[${trade_date_list}]]
        trade_date_list = JSON.parse(trade_date_list);
        for(i in  trade_date_list){
            $("#datePicker").append('<option value="'+trade_date_list[i]+'">'+trade_date_list[i]+'</option>')
        }
        var options = {
            url:  "/lhb/jg/list?tradeDate="+trade_date_list[0],
            modalName: "量化席位",
            pageSize:50,
            columns: [
            {
                field: 'stockCode',
                title: '代码'
            },
            {
                field: 'stockName',
                title: '名称',
                formatter: function(value, row, index) {
                   return '<a target="_blank" href="https://data.eastmoney.com/stock/lhb/'+row['stockCode']+'.html">'+value+'</a> '
                }
            },
            {
                field: 'buyCount',
                title: '买入席位数'
            },
            {
                field: 'sellCount',
                title: '卖出席位数'
            },
            {
                field: 'jBuyValue',
                title: '机构买入'
            },
            {
                field: 'jSellValue',
                title: '机构卖出'
            },
            {
                field: 'jBuyNet',
                title: '机构净买入'
            },
                {
                    field: 'gBuyValue',
                    title: '港资买入'
                },
                {
                    field: 'gSellValue',
                    title: '港资卖出'
                },
                {
                    field: 'gBuyNet',
                    title: '港资净买入'
                },

            {
                field: 'type',
                title: '单日/三日',
                formatter: function(value, row, index) {
                    if(value ==3){
                        return value;
                    }
                }
            }]
        };
        $.table.init(options);
        function change(){
            options['url'] = "/lhb/jg/list?tradeDate="+$("#datePicker").val()
            $.table.destroy();
            $.table.init(options);
        }
    </script>
</body>
</html>